package net.ant.watercalc.web.utils;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class ConvertUtil {

    public static  String[] getStringArrayFromType(double[] t) {
        if (t == null) return null;

        String[] strs = new String[t.length];
        for (int i = 0; i < t.length; i++) {
            strs[i] = String.valueOf(t[i]);
        }
        return strs;
    }

    public static double roundToSmall(double val){
        return new BigDecimal(val).setScale(2,RoundingMode.HALF_UP).doubleValue();
    }
}
